import { DriverCommand } from './driver-command';
import { DriverRunOptions } from '../type';
import { Command, CommandBuilder } from '$domain/service/commandBuilder';

export class DriverRunCommand extends DriverCommand {

  private _configFilePath: string;
  private _outputFilePath: string;

  constructor(options: DriverRunOptions) {
    super(options.driverName, options.logger);
    this._configFilePath = options.configFilePath;
    this._outputFilePath = options.outputFilePath;
  }

  protected buildCommand(): Command {
    return new CommandBuilder()
      .setExecutable(this._driver.executable)
      .setCommand('run')
      .setOptions({
        '-c': this._configFilePath,
        '-o': this._outputFilePath,
        '-d': this._driver.driverConfigPath
      })
      .build();
  }
}